package com.kexun.servlet.teacher;

import com.kexun.service.AdmService;
import com.kexun.service.TeaService;
import com.kexun.service.impl.AdmServiceImpl;
import com.kexun.service.impl.TeaServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/del")
public class del extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        //设置编码
        request.setCharacterEncoding("UTF-8");
        response.setContentType("text/html;charset=UTF-8");
        String stuNum = request.getParameter("stuNum");


        TeaService ts = new TeaServiceImpl();
        int i = ts.delStu(stuNum);

        System.out.println(i);
//        if(i>0){
//            response.getWriter().print("删除成功");
//            findStuInfo fd = new findStuInfo();
//            fd.doPost(request, response);
//            response.setHeader("refresh","3;url=");
//        }

    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doPost(request, response);
    }
}
